import { requestClient } from '#/api/request';

/**
 *  获取仓库选项
 */
async function getWareHouse(params:any) {
  return requestClient.get('/admin/Erpwarehouse/index', params);
}


/**
 *  获取大货采购列表
 */
async function getGoodsPurchaseList(params:any) {
  return requestClient.get('/admin/GoodsPurchase/index', params,);
}



/**
 *  删除采购单
 */
async function GoodsPurchaseDel(params:any) {
  return requestClient.get('/admin/GoodsPurchase/del', params, {responseReturn:'raw'});
}

/**
 *  获取包装厂
 */
async function getFactoryAll(params:any) {
  return requestClient.get('/admin/Factory/all', params);
}

/**
 *  获取成品列表
 */
async function getGoodsList(params: any) {
  return requestClient.post('/admin/ScmGoods/index', params);
}

/**
 *  获取风格树
 */
async function getTreeAll() {
  return requestClient.get('/admin/GoodsStyleCategory/getTreeAll');
}

/**
 *  获取改修记录
 */
async function getUpRecord(params:any) {
  return requestClient.post('/admin/goodsPurchaseDetail/getUpRecord',params);
}

/**
 *  获取详细
 */
async function getGoodsPurchase(params:any) {
  return requestClient.get('/admin/GoodsPurchase/edit',params);
}

/**
 *  修改
 */
async function editGoodsPurchase(params:any) {
  return requestClient.post('/admin/GoodsPurchase/edit',params,{responseReturn:'raw'});
}

/**
 *  新增
 *
 */
async function createGoodsPurchase(params:any) {
  return requestClient.post('/admin/GoodsPurchase/add',params,{responseReturn:'raw'});
}

/**
 *  审核
 *
 */
async function approval(params:any) {
  return requestClient.post('/admin/GoodsPurchase/approval',params,{responseReturn:'raw'});
}

/**
 *  审核
 *
 */
async function againstNoLoading(params:any) {
  return requestClient.post('/admin/GoodsPurchase/against',params,{responseReturn:'raw'});
}

/**
 *  标记完成
 *
 */
async function markDetailComplete(params:any) {
  return requestClient.post('/admin/GoodsPurchase/markDetailComplete',params,{responseReturn:'raw'});
}

/**
 *  标记完成列表页
 *
 */
async function markComplete(params:any) {
  return requestClient.post('/admin/GoodsPurchase/markComplete',params,{responseReturn:'raw'});
}


/**
 *  标记完成列表页
 *
 */
async function markStop(params:any) {
  return requestClient.post('/admin/GoodsPurchase/markStop',params,{responseReturn:'raw'});
}



/**
 *  获取合同抬头
 *
 */
async function getCompanyList() {
  return requestClient.get('/admin/purchase/getCompanyList');
}

/**
 *  获取合同抬头
 *
 */
async function daochuContractNew(params:any) {
  return requestClient.post('/admin/GoodsPurchase/daochuContractNew',params,{responseReturn:'raw'});
}


/**
 *  获取文件列表
 *
 */
async function getAttachmentRelationList(params:any) {
  return requestClient.post('/admin/AttachmentRelation/getList',params,{responseReturn:'raw'});
}

/**
 *  保存文件
 *
 */
async function setFileData(params:any) {
  return requestClient.post('/admin/AttachmentRelation/setFileData',params,{responseReturn:'raw'});
}



export {
  setFileData,
  getAttachmentRelationList,
  daochuContractNew,
  getCompanyList,
  markStop,
  markComplete,
  markDetailComplete,
  againstNoLoading,
  approval,
  getWareHouse,
  getGoodsPurchaseList,
  GoodsPurchaseDel,
  getFactoryAll,
  getGoodsList,
  getTreeAll,
  getUpRecord,
  getGoodsPurchase,
  editGoodsPurchase,
  createGoodsPurchase
}
